perm filename ITERAT.LSP[W79,JMC] blob
sn#419789 filedate 1979-02-22 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 (comment First an iterative version of the 91 function)
C00003 ENDMK
Cā;
(comment First an iterative version of the 91 function)
(setq base (setq ibase 10.))
(defun i91 (x s) (cond ((> x 100.) (ret91 (difference x 10) s))
(t (i91 (plus x 11) (cons 2 s)))))
(defun ret91 (y s) (cond ((null s) y)
((= (car s) 2) (i91 y (cons 1 (cdr s))))
(t (ret91 y (cdr s)))))